package com.easemob.chatuidemo.http;

/**
 * Created by base on 2016/6/22.
 */
public class ApiException extends RuntimeException {
    public ApiException(String resultCode) {
        super(getApiExceptionMessage(resultCode));
    }

    private static String getApiExceptionMessage(String resultCode) {
        String message = "";
        resultCode = resultCode.trim();
        if(resultCode.equals("9999")){
            message = "未定义错误";
        }else if(resultCode.equals("1001")){
            message = "消息命令字错误";
        }else if(resultCode.equals("1002")){
            message = "消息体格式错误";
        }else if(resultCode.equals("2001")){
            message = "小米账号未关联wanbu账号";
        }else if(resultCode.equals("2002")){
            message = "帐号注册多个用户,无法记录授权信息";
        }

        return message;
    }
}
